#ifndef ServerFlashBang_H
#define ServerFlashBang_H

#include "Engine.h"
#include "InputSet.h"
#include "MotionState.h"
#include <OgreEntity.h>
#include "PlayingFieldConstants.h"
#include "ScoreCard.h"
#include "RiotShield.h"
#include <SDL/SDL_mixer.h>
#include <stdlib.h>
#include "NetworkUtils.h"
#include "ServerScoreCard.h"
#include "ServerRiotShield.h"

#define SCORE 5
#define MAXSCORE 10
#define SFMSGSIZE 64

//a class that represents a flash bang in the scene
class ServerFlashBang{
public:
	ServerFlashBang(ServerScoreCard* score1, ServerRiotShield* player1, ServerScoreCard* score2, ServerRiotShield* player2, NetworkHandler *toSend, int target);
	void updateState();
	void alertToInput( const InputSet& input );
protected:
	bool checkShieldForHit(ServerRiotShield* shield);
	void randomizeVelocity(double* xv, double* yv);
	
	int timeToWait;
	bool gameOver;
	double dir;
	MotionState myPos;
	ServerScoreCard *s1;
	ServerScoreCard *s2;
	ServerRiotShield *p1;
	ServerRiotShield *p2;
	NetworkHandler *handler;
	int tgt;
	char buffer[SFMSGSIZE];
	Converter conv;
};

#endif
